import { http } from '@/utils/http'

/**
 * 列表
 */
export const getListApi = () => {
  return http({
    method: 'POST',
    url: '/V5/carMaintenance/getList',
    data: {},
  })
}

/**
 * 详情
 */
export const getDetailApi = (params) => {
  return http({
    method: 'POST',
    url: '/V5/carMaintenance/detail',
    data: params,
  })
}

/**
 * 详情
 */
export const getMaintenanceApi = () => {
  return http({
    method: 'POST',
    url: '/V5/maintenanceParam/getAllList',
    data: {
      status: 1,
      type: 1,
    },
  })
}
/**
 * 车列表
 */
export const getLicenseNoLikeApi = (e) => {
  return http({
    method: 'POST',
    url: '/V5/carInfo/getLicenseNoLike',
    data: {
      licenseNoLike: e,
      pageNumber: 1,
      pageSize: 30,
    },
  })
}
/**
 * 新增
 */
export const createApi = (params) => {
  return http({
    method: 'POST',
    url: '/V5/carMaintenance/save',
    data: params,
  })
}
/**
 * 编辑
 */
export const editApi = (params) => {
  return http({
    method: 'POST',
    url: '/V5/carMaintenance/edit',
    data: params,
  })
}
/**
 * 删除
 */
export const deleteApi = (params) => {
  return http({
    method: 'POST',
    url: '/V5/carMaintenance/delete',
    data: params,
  })
}

//获取下次保养时间和配置里程数
export const getNextDateAndKilometre = (params) => {
  return http({
    method: 'POST',
    url: '/V5/carMaintenance/getNextDateAndKilometre',
    data: params,
  })
}

/** 关闭保养单 */
export const closeApi = (params: any) => {
  return http({
    method: 'POST',
    url: '/V5/carMaintenance/close',
    data: params,
  })
}
